<template>
  <Loading />
  <Dialogue />
  <ModalPopup @cancel="handleModalCancel" @confirm="handleModalConfirm" />
</template>

<script setup lang="ts">
import Dialogue from "@/components/dialogue.vue";
import Loading from "@/components/loading.vue";
import ModalPopup from "@/components/modalPopup.vue";
import { useStore } from "vuex";

const store = useStore();

const emits = defineEmits<{
  (e: "modal-cancel"): void;
  (e: "modal-confirm"): void;
}>();

const handleModalCancel = () => {
  emits("modal-cancel");
  store.dispatch("toggleCancel", {});
}

const handleModalConfirm = () => {
  emits("modal-confirm");
  store.dispatch("toggleSuccess", {});
}
</script>

<style scoped></style>
